#include <iostream>
#include <string>
using namespace std;

template <typename T>
bool is_same(T, T){
    return true;
};

template <typename T, typename U>
bool is_same(T,U){
    return false;
}
//-------------------------------------
template <typename T, typename U>
struct mp_is_same {
    typedef char yes_type;
    typedef struct {
        char d[8]; 
    } no_type;

    template <typename V>
    static yes_type is_same_tester(V,V);
    template <typename X, typename Y>
    static no_type is_same_tester(X,Y);

    const static bool value = sizeof(yes_type) == sizeof(is_same_tester(T(),U()));
};

int main()
{
    cout << is_same(1,3) << endl;
    double d = 3.3;
    string str = "hevake";
    cout << is_same(d, str) << endl;
    cout << "--------------" << endl;
    cout << mp_is_same<int, int>::value << endl;
    cout << mp_is_same<double, string>::value << endl;
    cout << mp_is_same<string, string>::value << endl;
    return 0;
}
